import { createApp, nextTick } from 'vue'
import App from './App.vue'
import router from '@/router/index'
import store from '@/store/index';
import '@/assets/style/index.less';
import '@/assets/style/ant.less';
import 'ant-design-vue/dist/antd.css';
import FeLoading from '@/components/loading/index';
import Cookie from '@/utils/util';
import {setI18n} from '@/locales';
import * as Icons from '@ant-design/icons-vue'
import { setupDirectives } from '@/plugins/directtive';

const app = createApp(App);

setI18n(app);
app.config.globalProperties.$CookieTool = Cookie;

nextTick(()=> {
    // 配置全局对象
    app.config.globalProperties.$icons = Icons
// Antd 注入全部图标（这样注入之后，就可以全局直接使用 icon 组件，不需要每个页面去引入了）
    for (const key in Icons) {
        // @ts-ignore
        app.component(key, Icons[key])
    }
})


app.use(FeLoading).use(store).use(router).mount('#app')

setupDirectives(app)


